<div class="WindowList" style="height:1000px;" onMouseMove="$(this).css({height:'auto'});">
    <style>
	.form-none{ border:none; background:none; width:80px; font-size:12px; padding:5px; border:1px solid transparent;}
	.form-cover{position: absolute;width: 100%;height: 100%;top: 0;left: 0;z-index: 4;}
	.form-group{ position:relative;}
	.text-green{ color:#5cb85c}
	.hideSign{display: inline-block; color:#5cb85c !important; line-height:33px; margin-right:-16px;}
	.labelSign{ position:relative; min-width:70px; padding:5px; padding-left:30px;}
	.reviewerDataBox{ min-width:70px; margin-right:5px; float:none;}
	.hrSign{ width:100%; position:absolute; left:0; margin-top:-5px;}
	.reviewerBox{display:inline-block;}
	.reviewerBox .label{padding-right:24px;}
	.box{ background:#fff; height:34px;}
	.box-content{padding: 6px 12px;border: 1px solid #ddd; height:74px; overflow:hidden; text-overflow:ellipsis;}
	.table{margin:0;}
	.table-box{ padding:10px;background:#fff;}
	.seleBox{ border:none !important;}
	.box-impo > .important{ color:#999 !important;}
	.box-impo > :not(.important){ font-weight:bold;}
	.text-upload{display: inline-block;position: absolute;left: 49%;cursor: pointer;z-index: 0;font-weight: bold;margin-top:8px;}
	.table-group{ display:table;}
	.table-group .table-cell{ display:table-cell; min-width:80px;}
	.limitContent{ height:18px; overflow:hidden;}
	/*工作选项卡*/
	.text-black{ color:black;}
	.heading-custom{ border-left:1px solid #ddd; border-bottom:1px solid #ddd; margin-bottom:15px;}
	.heading-custom .nav .active{ border-top:2px solid #65CEA7; border-bottom:1px solid #fff;}
	.heading-custom .nav li{ border-top:1px solid #ddd; border-right:1px solid #ddd; height:auto; min-width:82px; text-align:center;}
	.table-gray{ border-top:1px solid #ddd; border-bottom:1px solid #ddd; margin-top:15px;}
	.table-gray thead th{ background-color:#f3f3f3; border:none !important;}
	.table-gray th,.table-gray td{ text-align:center; min-width:60px}
	
	/*进度动态列表*/
	.progress-box{ margin:15px 0; width:100%; overflow:hidden;}
	.progress-box > img{ margin-right:10px; border:1px solid #ddd;}
	.progress-box > div{ max-width:600px;}
	.progress-box .text-muted{ font-size:12px;}
	.progress-box .content{ height:20px; overflow:hidden;}
	/*工作列表*/
	.taskMissionTreeBox .tree_a{ overflow:hidden; max-width:320px; text-overflow:ellipsis; white-space:nowrap;}
	.taskMissionTreeBox ul{ margin:0;}
	.taskMissionTreeBox li{ list-style:none; line-height:36px !important; position:relative; }
	.taskMissionTreeBox > li{ padding:10px !important; background:white; border:1px solid #eee;margin-bottom:15px !important;}
	.taskMissionTreeBox span{ line-height:inherit !important;}
	/*工作表单点击菜单*/
	.mission_extendField{ position:absolute; top:0;right:0;  background:white; box-shadow:0 1px 4px rgba(0,0,0,0.14);  width:150px; min-height:40px; z-index:3;}
	#TaskMissionList .btn{color:#fff;}
	.aui_border .aui_dialog .nobg.nopadn{background:none !important; padding:0 !important;}
	.aui_inner.nobg.nopadn{background:#eff0f4;}
	.nav-tabs li{height:auto;}
	.mission_extendField a{ width:100%; display:block; float:left; padding:5px 10px !important; margin-right:-3px; padding-left:6px;}
	.mission_extendField a:hover{ text-decoration:none !important; background:#efefef;}
</style>
    <!--任务主信息-->
    <form method="post" class="formdailyedit" style="position:relative;" novalidate action="{:U('update', array('id' => $info['id']))}">
        <h4 class="text-black">
        	<b class="text-elli">{$info['title']}</b>
            <?php if($info['creator_id']=$UserInfo){ ?>
                <button type="button" class="btn btn-sm btn-default edit-btn pull-right"><i class="fa icon-edit"></i> 补充内容</button>
                <button type="submit" class="btn btn-sm hidden btn-success save-btn pull-right"><i class="fa icon-save"></i> 保存内容</button>
            <?php } ?>
            <div class="clearfix"></div>
        </h4>
        <div class="form-group">
            <div class="box-content">
                <span class="content">{$info['remark']}</span>
            </div>
            <textarea rows="3" name="remark" class="form-control hidden">{$info['remark']}</textarea>
            <div class="box">
                <div class="input-group-btn pull-left dropdown" style=" margin-bottom:0;" data-position="bottom" data-intro="选择分类" >
                    <button class="btn btn-default dropdown-toggle typebtn straight"  type="button" data-toggle="dropdown">
                        <?php if(!empty($info['type_name'])){
                            echo($info['type_name']);
                        }else{ echo('分类');} ?>
                            
                            <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li onclick="_openWindow('{:U('Task_daily/addform')}',500, '添加分类', '确定',null,'')" class="tab" value="0" pre=" + 添加分类" style="margin-bottom:0">
                            <a href="javascript:;">
                                + 添加分类
                            </a>
                        </li>
                        <li class="divider"></li>
                        <volist name="table" id="tab">
                            <li class="tab" value="{$tab.id}" pre="{$tab.title} ">
                                <a href="javascript:void(0)">
                                    {$tab.title} 
                                </a>
                            </li>
                        </volist>
                    </ul>
                    <span class="tab_id"></span>
                </div>
                <div class="pull-left task-sele" data-position="bottom" data-intro="选择负责人" >
                    <html:listselect class="b hideSign pull-left" name="member" selected="info['member_id']" multiple="0" url="{:U('Member/selectText')}" title="负责人"/>
                    <script>$('.b.hideSign.fa.icon-user').insertBefore('.box .reviewerDataBox');</script>
                </div>
                <div class="pull-right" data-position="bottom" data-intro="截止时间" >
                    &nbsp;&nbsp;&nbsp;
                    <i class="fa icon-calendar-o text-green"></i>
                    <input placeholder="截止时间" type="text" style="cursor:pointer;display: inline;" value="{:date('Y-m-d',$info['realtime'])}" readonly class="form-none datepicker" name="realtime">
                </div>
                <div class="pull-right box-impo" style="line-height:30px;" data-position="bottom" data-intro="紧急程度" >
                    <span href="javascript:void(0)" value='1'>紧急程度：{$_GET['rank']}星</span>&nbsp;
                </div>
                <div style="clear:both;">
                </div>
            </div>
            <if condition="$info['member_id']!=$UserInfo&&$info['creator_id']!=$UserInfo">
                <div class="form-cover"></div>
            </if>
        </div>
        <div class="clearfix"></div>
    </form>
    <section class="panel" style="box-shadow:none;border-radius:0;">
        <header class="panel-heading heading-custom">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#home2" data-toggle="tab">
                        工作分配
                    </a>
                </li>
                <li class="">
                    <a href="#profile2" data-toggle="tab">
                        附件
                    </a>
                </li>
                <li class="">
                    <a href="#contact2" data-toggle="tab">
                        积分明细
                    </a>
                </li>
                <li class="">
                    <a href="#contact22" data-toggle="tab">
                        进度信息
                    </a>
                </li>
            </ul>
        </header>
        <div class="">
            <!--任务其它详细信息（选项卡）-->
            <div class="tab-content">
                <div class="tab-pane active" id="home2">
                    <?php //如果当前用户是创始人或者是负责人，则可添加工作，和下面的工作树上面显示所有人的工作
                    $data=['task_id'=>$info['id']];
                    if($info['member_id']==$UserInfo||$info['creator_id']==$UserInfo){ 
                    ?>
                    <div class="form-group form-task" style="text-align:right;<if condition="count($formList) eq 1">
                        display:none;
                        </if>
                        ">
                        <volist name="formList" id="vo">
                            <a onClick="taskFormLineBox('{$vo['id']}')" class="btn btn-success" href="javascript:void(0)">
                                {$vo.name}
                            </a>
                        </volist>
                    </div>
                    <?php }else{ $data['member_id']=$UserInfo;  } ?>
                        <div class="form-group" data-position="bottom" data-intro="工作安排" >
                            <div id="taskFormLineBox" style="padding:0;">
                            </div>
                            <form id="FormLineFrom" class="checkoutform" method="post" action="{:U('Taskform/getTaskformline')}">
                            	<if condition="$info['member_id']==$memberInfo['id']">
                                    <a href="javascript:;" onClick="FormListAdd();" class="btn btn-default addformline-btn">
                                        <i class="fa icon-plus"></i> 加一行
                                    </a>
                                </if>
                                <div id="TaskMissionList"></div>
                            </form>
                            <div id="TaskMissionListpages">
                            </div>
                            <div class="taskMissionTreeBox ztree" id="taskMissionTree">
                            </div>
                        </div>
                </div>
                <!--<div class="tab-pane" id="about2"></div>-->
                <div class="tab-pane" id="profile2">
                    <form action="{:U('update', array('id' => $info['id']))}" id="formimgurl">
                        <div id="filebox" class="dropzone">
                      
                                <div style="padding:0px; text-align:center;">
                                    说明：此处用来上传该工作所用到的文档，上传文件转换格式需要15秒左右，
                                </div>
                                
                                   <div style="padding:8px; text-align:center;">
                                    可以关闭窗口做其他操作，只可上传办公文档。上传完成后点击即可预览，删除后无法找回，请另外保存原文件。
                                </div>
                            
                                   <volist name="swfpath" id="swf" key="k">
                                    
                                    <div id="{$swf}" class="preview processing image-preview success">
                                        <a onclick="remove_document({$swf});" style="position:absolute; bottom:0; right:0; width:26px; height:26px; line-height:26px; text-align:center; background:#f00; color:#fff; font-size:24px;">
                                            x
                                        </a>
                                        <div class="details">
                                   
                                            <div class="filename">
                                                <span>查看文档</span>
                                            </div>
                                            <div class="size">
                                               
                                            </div>
                                         <a  target="_blank" href="{:U('Flash/index',array('id'=>$swf))}"> <img  src="__PUBLIC__/images/ico/{$docname[$k]}ico.png"></a>
                                        </div>
                                        <div class="progress">
                                            <span class="upload" style="width: 100%;"></span>
                                        </div>
                                        <div class="success-mark">
                                            <span>✔</span>
                                        </div>
                                        <div class="error-mark">
                                            <span>✘</span>
                                        </div>
                                        <div class="error-message">
                                            <span></span>
                                        </div>
                                     
                                    </div>
                                </volist>
                          
                            <!--    <volist name="imgurl" id="img">
                                    <div class="preview processing image-preview success">
                                        <a onclick="$(this).parent().remove();" style="position:absolute; bottom:0; right:0; width:26px; height:26px; line-height:26px; text-align:center; background:#f00; color:#fff; font-size:24px;">
                                            x
                                        </a>
                                        <div class="details">
                                            <div class="filename">
                                                <span>plus-white.png</span>
                                            </div>
                                            <div class="size">
                                                <strong>0.1</strong> KB
                                            </div>
                                            <img alt="plus-white.png" src="__PUBLIC__{$img}">
                                        </div>
                                        <div class="progress">
                                            <span class="upload" style="width: 100%;"></span>
                                        </div>
                                        <div class="success-mark">
                                            <span>✔</span>
                                        </div>
                                        <div class="error-mark">
                                            <span>✘</span>
                                        </div>
                                        <div class="error-message">
                                            <span></span>
                                        </div>
                                        <input type="hidden" value="{$img}" name="img_url[]">
                                    </div>
                                </volist>-->
                               

                        </div>
                    </form>
  					<div class="text-upload">点击上传附件</div> 
                    <iframe src="{:U('upload')}" name="uploadiframe" appendto="#filebox" id="uploadiframe" class="uploadiframe pull-right" style="height:40px; width:60%;" filename="img_url[]"  data-position="bottom" data-intro="此处添加附件"></iframe>
                    <div class="clearfix"></div>
                </div>
                <div class="tab-pane" id="contact2">
                    <div class="table-box" id="TaskInteRet" data-position="bottom" data-intro="项目积分分配" >
                        <!--人员分数表-->
                        <notempty name='inteRet'>
                            <table class="table table-bordered ">
                                <thead>
                                    <tr>
                                        <th>名字</th>
                                        <volist name="InteTypeList" id="vo">
                                            <th>{$vo}</th>
                                        </volist>
                                    </tr>
                                </thead>
                                <tbody>
                                    <volist name="inteRet" id="vo">
                                        <tr>
                                            <td>{$vo.name}</td>
                                            <volist name="InteTypeList" id="tvo">
                                                <td>{:intval($vo['integral'][$key])}</td>
                                            </volist>
                                        </tr>
                                    </volist>
                                </tbody>
                            </table>
                            <else/>
                            <div style="padding:8px; text-align:center;">
                                暂无积分分配
                            </div>
                        </notempty>
                    </div>
                </div>
                <div class="tab-pane" id="contact22">
                    <div class="form-group" data-position="bottom" data-intro="动态信息" >
                        <!--动态信息的头样式
                    <div class="logTit">
                        <div class="logSig">
                            <i class="fa icon-stack-exchange"></i>
                            <span class="sigArr"></span>
                        </div>
                        <h5>动态信息</h5>
                    </div>-->
                        <div id="TaskProgressList">
                        </div>
                        <div id="TaskProgressListpages">
                            
                        </div>
                    </div>
                    <form action="{:U('Task_daily/progressInsert')}" id="TaskProgressInsertform" method="post">
                        <input type="hidden" name="task_id" value="{$info['id']}">
                        <div class="form-group row" data-position="bottom" data-intro="提交最新进度信息" >
                            <div class="col-xs-10">
                                <input datatype="*"  nullmsg="动态内容不能为空" errormsg="不支持特殊字符" type="text" class="form-control" placeholder="请输入进度信息" name="remark" />
                            </div>
                            <div class="col-xs-2">
                                <button type="submit" class="btn btn-success pull-right btn-block">提交进度</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
    <form action="{:U('Task_daily/progressList')}" id="TaskProgressListform">
        <input type="hidden" name="id" value="{$info['id']}">
    </form>
    <form method="get" action="{:U('Task_daily/inteRet')}" id="TaskInteRetform">
        <input type="hidden" name="id" value="{$info['id']}">
    </form>
    <form action="{:U('Mission/TaskMissionList')}" id="TaskMissionListform">
        <input type="hidden" name="task_id" value="{$info['id']}">
    </form>
    <script>
//点击文字触发上传
$("#profile2 .text-upload").click(function(e) {
	document.getElementById('uploadiframe').contentWindow.$(".dropzone").click();
});
/*
$('.WindowList').parents('.aui_inner').addClass('nobg nopadn');
$('.WindowList').parents('.aui_main').addClass('nobg nopadn');
$('.WindowList').parents('.aui_content').addClass('nobg nopadn');*/
function FormSend(e){
	var data = $('#FormLineFrom').serialize();
	$(e).hide();
	$(e).next('span').removeClass('hidden');
	$.ajax({
		url : "{:U('Taskform/getTaskformline')}",
		data: data,
		type:'POST',
		dataType:"json",
		success: function(ret){
			$('#TaskMissionListform').submit();
			$('.FormListBox tr').remove();
			FormListAdd();
		},
		error:function(){
			alert('系统繁忙！请稍候重试……');
			$(e).show();
			$(e).next('span').addClass('hidden');
		}
	});
} 
function taskFormLineBox(fid){
	$.get('{:U('Taskform/getTaskformline')}', {id:fid, task_id:<?php echo $info['id'];?>}, function(ret){
		if(ret.statu == 0){
			$('#taskFormLineBox').html(ret.tbody);
		}
	}, 'json');
}
//树状图的配置
var settingbefore = {};
$(".box-impo > a").click(function(e) {
    $(".box-impo > a").addClass("important");
	$(this).removeClass("important");
});

//递交发送的方法
function mission_send(id,e){
	if(!confirm('确定递交吗？')){
		return false;
	}
	hideLayer();
	$.post('{:U('Mission/send')}', {id:id}, function(data){
		if(data.status == 1){
			$('#TaskMissionListform').trigger('submit');
		}else{
			$.ThinkBox.error(data.info,{'delayClose':1000});
		}
	}, 'json');
}
//递交取消的方法
function mission_cancel(id,e){
	if(!confirm('确定取消吗？')){
		return false;
	}
	hideLayer();
	$.post('{:U('Mission/cancel')}', {id:id}, function(data){
		if(data.status == 1){
			$('#TaskMissionListform').trigger('submit');
		}else{
			$.ThinkBox.error(data.info,{'delayClose':1000});
		}
	}, 'json');
}
//分类点击切换
$('.tab').each(function(){
	$(this).click(function(){
		val=$(this).attr('value');
		setter=$(this).attr('pre');
		$('.tab_id').html("<input type='hidden' name='type_id' value="+val+"><input type='hidden' name='type_name' value="+setter+">");
		$('.typebtn').html(setter+" <span class='caret'></span>");
	});
});
//重要级别点击切换
$(".important").click(function(e) {
    $(".materiality").val($(this).attr('value'));
});

function FormSend(e){
	var data = $('#FormLineFrom').serialize();
	$(e).hide();
	$.ThinkBox.success('正在处理',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
	$(e).next('span').removeClass('hidden');
    $.ajax({
		url : "{:U('Taskform/getTaskformline')}",
		data: data,
		type:'POST',
		dataType:"json",
		success: function(ret){
			$.ThinkBox.success('保存成功！',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
			$('#TaskMissionListform').submit();
			$('.FormListBox tr').remove();
			//FormListAdd();
		},
		error:function(){
			$.ThinkBox.success('系统繁忙！请稍候重试……',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
			
			$(e).show();
			$(e).next('span').addClass('hidden');
		}
	});
} 

function FormListAdd(){
$.ThinkBox.success('正在加载……',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
$.post('<?php echo U('Taskform/getTaskformline', array('id' => $formList[0]['id'], 'task_id' => $info['id']));?>', {id:<?php echo $formList[0]['id'];?>}, function(ret){
	$.ThinkBox.success('加载成功！',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
		var h = $(ret.tbody);
		h.find('textarea').click(function(e) {
            $(this).attr('rows', '5');
			$(this).blur(function(e) {
            $(this).attr('rows', '1');
        });
        });
		h.prependTo('.FormListBox');
		h.addClass('formline');
		$('.formline:gt(1)').find('.addformline-btn').hide();
		$('.formline:gt(1)').find('.saveall-btn').hide();
		$('.formline:gt(1)').find('.delete-btn').show();
		$(".existLine:eq(1)").remove();
	}, 'json');
}
//积分明细
$('#TaskInteRet').ajaxlist();
//任务工作列表
$('#TaskMissionList').ajaxlist({success:function(){
	
	<if condition="count($formList) eq 1">
	FormListAdd();
	</if>
	
	$("#TaskMissionList").getNiceScroll().remove();
	$("#TaskMissionList").niceScroll({styler:"fb",cursorcolor:"#65cea7", cursorwidth: '5', cursorborderradius: '0px', background: '#424f63', spacebarenabled:false, cursorborder: '0'});
}});
//任务进度列表
$('#TaskProgressList').ajaxlist({nodata:'<div style="padding:50px 0;"><p style="text-align:center">你需要每天或每周在这里填写相关任务完成情况</p></div>',loadmorenodata:'<p style="color:#ccc;">已经显示所有动态</p>',append:true,scrollload:true});
//任务进度提交
$("#TaskProgressInsertform").Validform({
	tiptype:function(){
		return false;	
	},
	ajaxPost:true,
	callback:function(data){
		$.ThinkBox.success('提交成功',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
		$("#TaskProgressListform").submit();
		$("#TaskProgressInsertform")[0].reset();
	}
});
//点击内容切换表单元素
$('.box-content').click(function(e) {
	e.preventDefault();
	if($('.edit-btn').length){
    	$('.edit-btn').click();
	}
	e.stopPropagation();
});

$('.edit-btn').click(function(e) {
    $('.formdailyedit [name="remark"]').removeClass('hidden').focus().select();
	$('.formdailyedit [name="remark"]').prev().addClass('hidden');
	$('.edit-btn').addClass('hidden');
	$('.save-btn').removeClass('hidden');
});

//补充内容时使用AJAX提交
$('.formdailyedit').submit(function(e) {
    var data = $(this).serialize();
	$.ajax({
		url : $(this).attr('action'),
		data: data,
		dataType:"json",
		type:'POST',
		success: function(ret){
			$('.formdailyedit [name="remark"]').addClass('hidden');
	        $('.formdailyedit [name="remark"]').prev().removeClass('hidden');
	        $('.edit-btn').removeClass('hidden');
	        $('.save-btn').addClass('hidden');
			$('.formdailyedit [name="remark"]').prev().find('.content').html($('.formdailyedit [name="remark"]').val());
			$.ThinkBox.success('保存成功',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
		}
	});
	return false;
});

$("#filebox").bind("DOMNodeInserted",function(e){
	var data = $('#formimgurl').serialize();
	$.ajax({
		data : data,
		url : $('#formimgurl').attr('action'),
		type:'POST',
		dataType:"json",
		success: function(ret){
			$.ThinkBox.success('上传成功',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
		}
	});
	
});

$(window).trigger('load');


function remove_document(id){
	var a=id;
	if(!confirm('确定删除该文档吗？')){
					return false;
				}
  	$.ajax({
		url:'{:U('Flash/remove')}',
		async:false,
		dataType:"json", 
		type: "POST", 
		data: {'id':id},
		success: function(msg){
	    if(msg.status==0){
		$('#'+a).remove();
			  }
		    }
		});
}


</script>
</div>
